{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f1f90baf-8701-4133-8b20-73f8208492f4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE= 0.04\n"
     ]
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "y_true=tf.constant([1,0],dtype=tf.float32)\n",
    "y_pred=tf.constant([0.8,0.2],dtype=tf.float32)\n",
    "mse=tf.keras.losses.mse(y_true,y_pred)\n",
    "print(\"MSE=\",mse.numpy())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "17299add-3d2d-4b9c-9f1c-d06dcd23e858",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CEE= 0.22314353\n"
     ]
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "y_true=tf.constant([1,0],dtype=tf.float32)\n",
    "y_pred=tf.constant([0.8,0.2],dtype=tf.float32)\n",
    "cee=tf.keras.losses.categorical_crossentropy(y_true,y_pred)\n",
    "print(\"CEE=\",cee.numpy())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8842c7b0-1672-4ddc-8646-9c0b3775a6c3",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
